home *** CD-ROM | disk | FTP | other *** search
/ 8bitfiles.net/archives / archives.tar / archives / compuserve-file-archive / 05 Programming / LADS.TXT < prev    next >
Text File  |  2019-04-13  |  1KB  |  37 lines

  1.  
  2. #: 13692 S4/Machine Code
  3.    13-Feb-88  20:53:08
  4. Sb: #untrapped error
  5. Fm: Rick Joslin 72167,3312
  6. To: Any LADS user
  7.  
  8.  To any of you who use Richard Mansfield's fine assembler, you
  9. probably thought you had made every possible error you could.
  10. I found one while trying to adapt the program to run on the
  11. B-128 that I had never encountered while using the program for
  12. years on my C64.  In a nutshell:
  13.  
  14. lda #bank (you meant to say lda bank, this is the error)
  15. sta somewhere
  16. etc., more code
  17. bank .byte 0
  18. (this is an address label, say $48A9 or something)
  19.  
  20.  Notice that 'bank' is a two byte address, and yet you are
  21. trying to load it into one byte (the accumulator).  If lads
  22. stopped and told you this, all would be well, but it won't!
  23. What it does instead is load the low byte of the address into
  24. A, and then somehow gets its address counter off by one byte.
  25. The result is that all the code after lda #bank may look pretty
  26. good on the screen, but will be off by one byte, and your program
  27. will inevitably crash.  If you start getting some 'impossible'
  28. crashes after adding some source code, you might look for an
  29. error like this.
  30.  
  31.  Hope this isn't old    at to everyone -- I thought it was interesting
  32. enough to report on, since it made me waste several hours today.
  33.  
  34.  Comments welcome, email or forum.
  35.  
  36.  Rick Joslin (72167,3312)
  37.